﻿<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="DiscussionTopic.aspx.vb" Inherits="HauntedNetworkingSite.DiscussionTopic" %>

<%@ Register src="Banner.ascx" tagname="Banner" tagprefix="uc1" %>

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Discussion Topic</title>
    <style type="text/css">
        .style1
        {
            width: 100%;
        }
        .style2
        {
            height: 183px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
        <uc1:Banner ID="Banner1" runat="server" />
    
    </div>
    <p>
        &nbsp;</p>
    <p>
        &nbsp;</p>
    <p>
        &nbsp;</p>
    <p>
        &nbsp;</p>
    <p>
        &nbsp;</p>
    <p>
        &nbsp;</p>
    <p>
        &nbsp;</p>
    <table class="style1">
        <tr>
            <td class="detailsclass" align="center" >
                <asp:DetailsView ID="DetailsView1" runat="server" 
                    AutoGenerateRows="False" 
                    DataSourceID="DiscussionTopicDataSource" Height="50px" Width="80%" 
                    GridLines="Horizontal" FieldHeaderStyle-CssClass="titleclass" 
                    FieldHeaderStyle-HorizontalAlign="Right" FieldHeaderStyle-Width="20%" 
                    >
                    <FieldHeaderStyle CssClass="titleclass" HorizontalAlign="Right" Width="20%" />
                    <Fields>
                        <asp:BoundField DataField="Topic" HeaderText="Topic     " 
                            SortExpression="Topic" />
                        <asp:BoundField DataField="Body" HeaderText="Body     " 
                            SortExpression="Body" />
                        <asp:BoundField DataField="Tags" HeaderText="Tags     " SortExpression="Tags" />
                        <asp:BoundField DataField="Category_Title" HeaderText="Category     " 
                            SortExpression="Category_Title" >
                            <HeaderStyle CssClass="titleClass" />
                        </asp:BoundField>
                        <asp:BoundField DataField="StartedBy" HeaderText="Author     " 
                            SortExpression="StartedBy" />
                    </Fields>
                </asp:DetailsView>
                <asp:SqlDataSource ID="DiscussionTopicDataSource" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:PlacesConnectionString %>" 
                    ProviderName="<%$ ConnectionStrings:PlacesConnectionString.ProviderName %>" 
                    
                    SelectCommand="SELECT [ID], [Topic], [Body], [Tags], [Category Title] AS Category_Title, [StartedBy] FROM [discussionforumQuery] WHERE ([ID] = ?)">
                    <SelectParameters>
                        <asp:QueryStringParameter Name="ID" QueryStringField="ID" Type="Int32" />
                    </SelectParameters>
                </asp:SqlDataSource>
            </td>
            <td class="style2">
            </td>
        </tr>
        <tr>
            <td align="center">
                <br />
                <asp:TextBox ID="tb_Reply" runat="server" Height="50px" TextMode="MultiLine" 
                    Width="250px">Reply to this topic here</asp:TextBox>
                <br />
                <br />
                <asp:Button ID="btn_Reply" runat="server" CssClass="buttonClass" Text="Reply" />
            </td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td align="center">
                <asp:ListView ID="ListView1" runat="server" 
                    DataSourceID="DiscussionTopicReplyDataSource" >
                    <ItemTemplate>
                        <span style="">UserName:
                        <asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' />
                        <br />
                        ReplyTime:
                        <asp:Label ID="ReplyTimeLabel" runat="server" Text='<%# Eval("ReplyTime") %>' />
                        <br />
                        Reply:
                        <asp:Label ID="ReplyLabel" runat="server" Text='<%# Eval("Reply") %>' />
                        <br />
                        <br />
                        </span>
                    </ItemTemplate>
                    <AlternatingItemTemplate>
                        <span style="">UserName:
                        <asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' />
                        <br />
                        ReplyTime:
                        <asp:Label ID="ReplyTimeLabel" runat="server" Text='<%# Eval("ReplyTime") %>' />
                        <br />
                        Reply:
                        <asp:Label ID="ReplyLabel" runat="server" Text='<%# Eval("Reply") %>' />
                        <br />
                        <br />
                        </span>
                    </AlternatingItemTemplate>
                    <EmptyDataTemplate>
                        <span>No replies.</span>
                    </EmptyDataTemplate>
                    <InsertItemTemplate>
                        <span style="">UserName:
                        <asp:TextBox ID="UserNameTextBox" runat="server" 
                            Text='<%# Bind("UserName") %>' />
                        <br />
                        ReplyTime:
                        <asp:TextBox ID="ReplyTimeTextBox" runat="server" 
                            Text='<%# Bind("ReplyTime") %>' />
                        <br />
                        Reply:
                        <asp:TextBox ID="ReplyTextBox" runat="server" Text='<%# Bind("Reply") %>' />
                        <br />
                        <asp:Button ID="InsertButton" runat="server" CommandName="Insert" 
                            Text="Insert" />
                        <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                            Text="Clear" />
                        <br />
                        <br />
                        </span>
                    </InsertItemTemplate>
                    <LayoutTemplate>
                        <div ID="itemPlaceholderContainer" runat="server" style="">
                            <span ID="itemPlaceholder" runat="server" />
                        </div>
                        <div style="">
                        </div>
                    </LayoutTemplate>
                    <EditItemTemplate>
                        <span style="">UserName:
                        <asp:TextBox ID="UserNameTextBox" runat="server" 
                            Text='<%# Bind("UserName") %>' />
                        <br />
                        ReplyTime:
                        <asp:TextBox ID="ReplyTimeTextBox" runat="server" 
                            Text='<%# Bind("ReplyTime") %>' />
                        <br />
                        Reply:
                        <asp:TextBox ID="ReplyTextBox" runat="server" Text='<%# Bind("Reply") %>' />
                        <br />
                        <asp:Button ID="UpdateButton" runat="server" CommandName="Update" 
                            Text="Update" />
                        <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                            Text="Cancel" />
                        <br />
                        <br />
                        </span>
                    </EditItemTemplate>
                    <SelectedItemTemplate>
                        <span style="">UserName:
                        <asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' />
                        <br />
                        ReplyTime:
                        <asp:Label ID="ReplyTimeLabel" runat="server" Text='<%# Eval("ReplyTime") %>' />
                        <br />
                        Reply:
                        <asp:Label ID="ReplyLabel" runat="server" Text='<%# Eval("Reply") %>' />
                        <br />
                        <br />
                        </span>
                    </SelectedItemTemplate>
                </asp:ListView>
                <br />
                <asp:SqlDataSource ID="DiscussionTopicReplyDataSource" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:PlacesConnectionString %>" 
                    ProviderName="<%$ ConnectionStrings:PlacesConnectionString.ProviderName %>" 
                    SelectCommand="SELECT [UserName], [ReplyTime], [Reply] FROM [DiscussionReply] WHERE ([Discussion_fkid] = ?)">
                    <SelectParameters>
                        <asp:QueryStringParameter Name="Discussion_fkid" QueryStringField="ID" 
                            Type="Int32" />
                    </SelectParameters>
                </asp:SqlDataSource>
                <br />
                <br />
            </td>
            <td>
                &nbsp;</td>
        </tr>
    </table>
    <p>
        &nbsp;</p>
    </form>
</body>
</html>
